//
//  KFAnimationInfo.mm
//  Imp
//
//  Created by Alex Carter on 24/06/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "KFAnimationInfo.h"
#import "KFAnimationState.h"

#import <QuartzCore/QuartzCore.h>

@implementation KFAnimationInfo
@synthesize beginTime;
@synthesize endTime;
@synthesize beginState;
@synthesize endState;
@synthesize key;
@synthesize animation;
@synthesize actor;

+ (KFAnimationInfo*) animationInfo
{
    return [[[KFAnimationInfo alloc] init] autorelease];
}

+ (KFAnimationInfo*) animationInfoWithAnimation:(CAAnimation*) theAnimation andActor:(id) theActor
{
    return [[[KFAnimationInfo alloc] initWithAnimation:theAnimation andActor:theActor] autorelease];
}

- (id) initWithAnimation:(CAAnimation*) theAnimation andActor:(id) theActor
{
    self = [super init];
    if (self != nil) 
    {        
        self.key = [NSString stringWithFormat:@"%d",[theAnimation hash]];        
        self.animation = theAnimation;
        self.actor = theActor;
    }
    return self;
}

- (void) dealloc
{
    self.key = nil;
    self.animation = nil;
    self.actor = nil;
    self.beginState = nil;
    self.endState = nil;
    [super dealloc];
}


@end
